<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:growl id="mensagens"/>
			<h:panelGroup id="panelDados">
				<p:fieldset legend="Dados Solicitação Serviço">
					<h:panelGrid columns="2">
						<h:outputLabel value="Descricao Servico:" for="descricaoServico"/>
						<h:inputText id="descricaoServico" value="#{manterSolicitacaoServicoMB.solicitacaoServico.descricaoServico}" />
					</h:panelGrid>				
					<p:panel header="Existem #{manterSolicitacaoServicoMB.solicitacaoServico.quantidadeObservacao} observações" toggleable="true" rendered="#manterSolicitacaoServicoMB.solicitacaoServico.quantidadeObservacao > 0}" collapsed="true">
						<ui:repeat var="observacao" value="#{manterSolicitacaoServicoMB.solicitacaoServico.listaObservacoes}">
							<h:outputText value="#{observacao}" />
							<br/>
						</ui:repeat>
					</p:panel>
				</p:fieldset>
				<p:fieldset legend="Informações complementares" rendered="#{manterSolicitacaoServicoMB.solicitacaoServico.ehNecessarioInformacoesAdicionais}">
					<h:outputLabel value="Observação" for="observacao"/>
					<p:inputTextarea id="observacao" value="#{manterSolicitacaoServicoMB.observacaoSolicitacaoServico}"/>
				</p:fieldset>
			</h:panelGroup>
			<p:spacer/>
			
			<p:commandButton action="#{manterSolicitacaoServicoMB.inserirSolicitacaoServico()}" value="Inserir" update="mensagens,panelDados" rendered="#{manterSolicitacaoServicoMB.modoInclusao}" ajax="false"/>
			<p:commandButton action="#{manterSolicitacaoServicoMB.alterarSolicitacaoServico()}" value="Alterar" update="mensagens,panelDados" rendered="#{manterSolicitacaoServicoMB.modoEdicao}" ajax="false"/>
			<p:commandButton action="#{manterSolicitacaoServicoMB.alterarSolicitacaoServico()}" value="Enviar" update="mensagens,panelDados" rendered="#{manterSolicitacaoServicoMB.modoComplementarInformacoes}" ajax="false"/>
		</h:form>
	</ui:define>
</ui:composition>